﻿@{
    ViewBag.Title = "首页";
}

@model Work3.Models.UserMsg

<div class="jumbotron">
    <h1>欢迎</h1>
    @if (ViewBag.Status == 1)
    {
        <p class="lead">管理员 @ViewBag.User</p>
    }
    else
    {
        <p class="lead">请先登录</p>
        @* 登录表单开撸 *@
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    用户登录
                </h3>
            </div>
            <div class="panel-body">
                @using (Html.BeginForm("Login", "Home"))
                {
                    // 用户ID
                    <div class="form-group">
                        @Html.LabelFor(model => model.Username, "账号", new { @class = "col-sm-1 control-label" })
                        @Html.TextBoxFor(model => model.Username, new { @class = "form-control" })
                    </div>
                    // 密码
                    <div class="form-group">
                        @Html.LabelFor(model => model.Password, "密码", new { @class = "col-sm-1 control-label" })
                        @Html.PasswordFor(model => model.Password, new { @class = "form-control" })
                    </div>
                    <input type="submit" value="登录" class="btn btn-primary col-sm-offset-1"/>
                }
            </div>
        </div>
    }
</div>